package ooday05;
/*
枚举的演示
 */
public class EnumDemo {
    public static void main(String[] args) {
       // Season s=Season.SPRING;
       // System.out.println(s.getSeasonName()+","+s.getSeasonDesc());
       /*Season[] sea= Season.values();
        for (int i=0;i<sea.length;i++){
            System.out.println(sea[i]);
            System.out.println(sea[i].getSeasonName());
            System.out.println(sea[i].getSeasonDesc());
        }
        Season s=Season.SPRING;//获取春天对象
        System.out.println(s.getSeasonName()+"，"+s.getSeasonDesc());
        */
        Season s=Season.AUTUMN;

        switch (s){
            case AUTUMN:
                System.out.println(s.getSeasonName()+","+s.getSeasonDesc());
                break;
            case SUMMER:
                System.out.println(s.getSeasonName()+","+s.getSeasonDesc());
                break;
            case SPRING:
                System.out.println(s.getSeasonName()+","+s.getSeasonDesc());
                break;
            case WINTER:
                System.out.println(s.getSeasonName()+","+s.getSeasonDesc());
                break;
        }
    }
}
